package com.cloud.log.kafka.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
	
    @Autowired
    private KafkaTemplate<String, String> template;
	
	@RequestMapping("/")
	public String index() {
		return "here is Log Center!";
	}
	
	@RequestMapping("/send")
	public String send() {
		
		template.send("myTopic", "Send From Controller");
		template.send("myTopic", " message1 ===> Send From Controller");
		return "Send to Log Center!";
	}
	
	
}
